/**
 * @author renato
 * Created on 03/11/2005
 * Updated on 02/04/2010
 */
package br.unb.data;

public class RandomData implements DataGenerator {

    /**
     *
     * @author Renato Sales Bizerra
     * Method that generates a random byte stream to be sent on the packet
     * <br>
     * 97-----122<br>
     * a-------z
     * @param len The size of the array to be created in bytes
     * @param data Random data
     * @return len number of bytes generated.
     */
    public int getNextData(byte data[], int len) {
        for (int i = 0; i < len; i++) {
            data[i] = (byte) ((Math.random() * 100) % 26 + 97);
        }
        return len;
    }
}
